package com.lz.football.module.youngTrain.view
{
	
	import com.common.utils.Reflection;
	import com.liangzhong.model.AppData;
	import com.lz.football.module.base.IComponent;
	
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	import lz.controls.core.TitleWindow;

	/**
	 * 出售球员后面板提示 
	 * @author lake
	 * 
	 */	
	public class SaleResultPanel extends TitleWindow implements IComponent
	{
		/**
		 *描述 
		 */		
		private var txtDesc 	:TextField;
		/**
		 *确认 
		 */		
		private var sureBtn	:SimpleButton;
		
		public function SaleResultPanel()
		{
			super();
		}
		/**
		 *初始化 
		 * 
		 */		
		public function initUI(view :Object = null):void
		{
			_symbolSkin = Reflection.createInstance("com.football.youngtrain.saleResultSkin");
			this.addChild(_symbolSkin);
			txtDesc = _symbolSkin.txtDesc;
			sureBtn = _symbolSkin.sureBtn;
			//背景框
			windowBg = _symbolSkin.windowBg;
			//设置可拖动
			dragEnabled = true;
			//初始化宽高
			width 	= _symbolSkin.width;
			height	= _symbolSkin.height;
			//设置关闭按钮
			setCloseBtn(_symbolSkin.closeBtn);
			//添加事件
			addEvtListener();
		}
		/**
		 *设置描述内容 
		 * 
		 */		
		public function setDescInfo():void
		{
			//设置描述内容
			var info :String = "经过经理人的周旋，该球童成功加盟法甲甲级俱乐部，说不定这是个能改变足球格局的孩子呢！得到签约金";
			info += AppData.getInstance().youngTrainManager.salePrice;
			info += "W欧元！感觉有点亏！";
			txtDesc.htmlText = info;
			//设置可拖动
			dragEnabled = true;
		}
		/**
		 *注册事件 
		 * 
		 */		
		public function addEvtListener():void
		{
			sureBtn.addEventListener(MouseEvent.CLICK,onCloseHandler);
		}
		/**
		 *关闭 
		 * @param e
		 * 
		 */		
		override protected function onCloseHandler(e:MouseEvent):void
		{
			super.onCloseHandler(e);
		}
		/**
		 *删除事件 
		 * 
		 */		
		public function removeEvtListener():void
		{
			sureBtn.removeEventListener(MouseEvent.CLICK,onCloseHandler);
		}
		/**
		 *销毁 
		 * 
		 */		
		public function destroyView():void
		{
			removeEvtListener();
		}
	}
}